package com.example.game.utils;

/**
 * @author CHENTAIWEN
 * @create 2023/2/21 9:22
 */
public enum GenshenEnum {
    role("role", "角色"),
    arms("arms", "武器"),

    armsType("armsType", "武器类型"),
    elementType("elementType", "元素类型"),

    fire("fire", "火"),
    thunder("thunder", "雷"),
    grass("grass", "草"),
    rock("rock", "岩"),
    water("water", "水"),
    ice("ice", "冰"),
    wind("wind", "风"),

    MagicInstrument("MagicInstrument", "法器"),
    OneHandedSword("OneHandedSword", "单手剑"),
    TwoHandedSword("TwoHandedSword", "双手剑"),
    arch("arch", "弓"),
    longHandle("longHandle", "长柄武器"),
    NULL("", ""),
    ;
    private String name;
    private String value;

    GenshenEnum(String name, String value) {
        this.name = name;
        this.value = value;
    }

    public static GenshenEnum name(String name) {
        for (GenshenEnum genshenEnum : GenshenEnum.values()) {
            if (genshenEnum.name.equals(name)) {
                return genshenEnum;
            }
        }
        return NULL;
    }

    public static GenshenEnum value(String value) {
        for (GenshenEnum genshenEnum : GenshenEnum.values()) {
            if (genshenEnum.value.equals(value)) {
                return genshenEnum;
            }
        }
        return NULL;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
}
